import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/exam/project/apply/page',
    method: 'get',
    params: query
  })
}
export function fetchKeynoteList(query) {
  return request({
    url: '/exam/project/apply/keynotePage',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/exam/project/apply',
    method: 'post',
    data: obj
  })
}

export function getApply(id) {
  return request({
    url: '/exam/project/apply/' + id,
    method: 'get'
  })
}

export function getApplyByProjectId(id) {
  return request({
    url: '/exam/project/apply/getByProjectId/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/exam/project/apply/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/exam/project/apply',
    method: 'put',
    data: obj
  })
}

export function submit(obj) {
  return request({
    url: '/exam/project/apply/submit',
    method: 'post',
    data: obj
  })
}

export function submitAudit(obj) {
  return request({
    url: '/exam/project/apply/submitAudit',
    method: 'post',
    data: obj
  })
}

/**
 * 生成文书
 * @param obj
 * @returns {AxiosPromise}
 */
export function genApplyWord(obj) {
  return request({
    url: '/exam/project/apply/genWord',
    method: 'post',
    data: obj
  })
}
